package org.fing.edu.uy.esbadp.core;

import java.io.Serializable;

public class AdpFlowSYNC implements AdpFlowInterface,Serializable {

	private static final long serialVersionUID = 3304311716724622249L;
	
	private String invokeSyncName;
	private String invokeSyncCategoryName;
	private long serviceId;
	
	
	/*define si el servicio es cacheble, esto solo aplicara a la hora de guardar en cache.
	 * no determina si se consume o no del cache, es la politica de adaptacion que determina eso.
	 */
	private boolean cacheable;
	private long ttl;
	private long ttidle;

	public AdpFlowSYNC(){};
	
	public AdpFlowSYNC(String invokeSyncName, String invokeSyncCategoryName, long serviceId) {
		super();
		this.invokeSyncCategoryName = invokeSyncCategoryName;
		this.invokeSyncName = invokeSyncName;
		this.cacheable = false;
		this.serviceId = serviceId;
	}
	
	public AdpFlowSYNC(String invokeSyncName, String invokeSyncCategoryName, boolean cacheable, long ttl, long ttidle, long serviceId) {
		super();
		this.invokeSyncName = invokeSyncName;
		this.invokeSyncCategoryName = invokeSyncCategoryName;
		this.cacheable = cacheable;
		this.ttl = ttl;
		this.ttidle = ttidle;
		this.serviceId = serviceId;
	}

	public String getServiceName() {
		return AdpFlowConstants.DeliverySyncServiceName;
	}

	public String getServiceCategoryName() {
		return AdpFlowConstants.DeliverySyncServiceCategoryName;
	}
		
	public String getInvokeSyncCategoryName() {
		return invokeSyncCategoryName;
	}

	public void setInvokeSyncCategoryName(String invokeSyncCategoryName) {
		this.invokeSyncCategoryName = invokeSyncCategoryName;
	}

	public String getInvokeSyncName() {
		return invokeSyncName;
	}

	public void setInvokeSyncName(String invokeSyncName) {
		this.invokeSyncName = invokeSyncName;
	}

	public boolean isCacheable() {
		return cacheable;
	}

	public void setCacheable(boolean cacheable) {
		this.cacheable = cacheable;
	}

	public long getTtl() {
		return ttl;
	}

	public void setTtl(long ttl) {
		this.ttl = ttl;
	}

	public long getTtidle() {
		return ttidle;
	}

	public void setTtidle(long ttidle) {
		this.ttidle = ttidle;
	}
	
	public long getServiceId() {
		return serviceId;
	}

	public void setServiceId(long serviceId) {
		this.serviceId = serviceId;
	}

	@Override
	public String toString() {
		return "AdpFlowSYNC [invokeSyncName=" + invokeSyncName
				+ ", invokeSyncCategoryName=" + invokeSyncCategoryName
				+ ", cacheable=" + cacheable + ", ttl=" + ttl + ", ttidle="
				+ ttidle + "]";
	}
	
}
